package com.qfedu.edu.iotserver.controller;


import com.qfedu.edu.iotserver.service.MenuService;
import com.qfedu.edu.pojo.Menu;
import com.qfedu.edu.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 权限资源表  前端控制器
 * </p>
 *
 * @author xiaobobo
 * @since 2024-09-13
 */
@RestController
@RequestMapping("/iotserver/menu")
@Api(tags = "菜单模块" , description = "菜单模块")
@Slf4j
public class MenuController {

    @Autowired
    private MenuService menuService;

    /**
     * 获取菜单
     * @return
     */
    @GetMapping("/getMenu")
    @ApiOperation(value = "获取菜单")
    //接口参数token
    @ApiImplicitParam(name="token",value = "用户令牌",required = true,dataType = "string",paramType = "header")
    public R getMenu() {
        List<Menu> menuList = menuService.getMenu();
        return R.ok().data("menu", menuList);
    }

}

